import {
    fetch
} from './service';
  
const Model = {
    namespace: 'messageandrecord',
    state: {
        
    },

    effects: {
        *fetch({ payload }, { call }) {
            const response = yield call(fetch, payload);
            if (!response.List) {
                return { status: 500 }
            }

            const data = []
            response.List.map(item =>{
                data.push({
                    key: item.Id,
                    id: item.Id,
                    h01: item.H01,
                    h02: item.H02,
                    h03: item.H03,
                    h26: item.H26,
                    s39: item.S39,
                    p11: item.P11,
                    time: item.Time
                })
                return 200
            })
            return {
                status: 200,
                totalPageSize: response.Page.TotalCount,
                data,
            }
        },

    },

    reducers: {
        
    },
}
export default Model;
  